# IP BASES

PLOT.add_base BaseLine.new("ip_df",      [0, 2],            :pcap )              # dont fragment
PLOT.add_base BaseLine.new("ip_flags",   [0, 2.power!( 3)], :pcap )   # ip   flags
PLOT.add_base BaseLine.new("ip_src",     [0, 2.power!(32)], :pcap )   # source ip address
PLOT.add_base BaseLine.new("ip_dst",     [0, 2.power!(32)], :pcap )   # destination ip address
PLOT.add_base BaseLine.new("ip_hlen",    [0, 2.power!( 4)], :pcap )   # header length
PLOT.add_base BaseLine.new("ip_len",     [0, 2.power!(16)], :pcap )   # packet length
PLOT.add_base BaseLine.new("ip_id",      [0, 2.power!(16)], :pcap )   # ip id
PLOT.add_base BaseLine.new("ip_mf?",     [0, 2], :pcap )              # more fragment ?
PLOT.add_base BaseLine.new("ip_off",     [0, 2.power!(13)], :pcap )   # ip offset 
PLOT.add_base BaseLine.new("ip_proto",   [0, 2.power!( 8)], :pcap )   # protocol 
PLOT.add_base BaseLine.new("ip_sum",     [0, 2.power!(16)], :pcap )   # checksum
PLOT.add_base BaseLine.new("ip_ttl",     [0, 2.power!( 8)], :pcap )   # time to live
PLOT.add_base BaseLine.new("ip_ver",     [0, 2.power!( 4)], :pcap )   # version
PLOT.add_base BaseLine.new("ip_tos",     [0, 2.power!(16)], :pcap )   # total length

# TCP BASES  
PLOT.add_base BaseLine.new("tcp_ack",      [0, 2.power!(32)], :pcap) #       Return acknowledgement number.
PLOT.add_base BaseLine.new("tcp_data_len", [0, 2.power!(32)], :pcap) #!!!!!! dont know if this value is enough.. guessed because im lazy   Return length of data part.
PLOT.add_base BaseLine.new("tcp_dport",    [0, 2.power!(16)], :pcap) #       Return destination port number.
PLOT.add_base BaseLine.new("tcp_sport",    [0, 2.power!(16)], :pcap) #       Return source port number.
PLOT.add_base BaseLine.new("tcp_flags",    [0, 2.power!(16)], :pcap) #       Return the value of 6-bits flag field.

PLOT.add_base BaseLine.new("tcp_off",      [0, 2.power!(4)], :pcap)  #       Return TCP data offset (header length). (Unit: 4-octets)
PLOT.add_base BaseLine.new("tcp_seq",      [0, 2.power!(32)], :pcap) #       Return sequence number.
PLOT.add_base BaseLine.new("tcp_sum",      [0, 2.power!(16)], :pcap) #       Return the value of checksum field.
PLOT.add_base BaseLine.new("tcp_urp",      [0, 2.power!(16)], :pcap) #       Return urgent pointer.
PLOT.add_base BaseLine.new("tcp_win",      [0, 2.power!(16)], :pcap) #       Return window size.

PLOT.add_base BaseLine.new("tcp_fin?",     [0, 2], :pcap)
PLOT.add_base BaseLine.new("tcp_syn?",     [0, 2], :pcap)
PLOT.add_base BaseLine.new("tcp_rst?",     [0, 2], :pcap)
PLOT.add_base BaseLine.new("tcp_psh?",     [0, 2], :pcap)
PLOT.add_base BaseLine.new("tcp_ack?",     [0, 2], :pcap)
PLOT.add_base BaseLine.new("tcp_urg?",     [0, 2], :pcap)

# UDP BASES  

PLOT.add_base BaseLine.new("udp_dport", [0, 2.power!(16)], :pcap) # destination port number.
PLOT.add_base BaseLine.new("udp_len",   [0, 2.power!(16)], :pcap) # Return value of length field. This value represents the length in octets of this UDP datagram.
PLOT.add_base BaseLine.new("udp_sum",   [0, 2.power!(16)], :pcap) # Return the value of checksum field.
PLOT.add_base BaseLine.new("udp_sport", [0, 2.power!(16)], :pcap) # Return source port number.

# ICMP Bases
PLOT.add_base BaseLine.new("icmp_cksum",     [0, 2.power!(16)], :pcap) #   Return ICMP checksum.
PLOT.add_base BaseLine.new("icmp_code",      [0, 2.power!( 8)], :pcap) #   Return ICMP code.
PLOT.add_base BaseLine.new("icmp_type",      [0, 2.power!( 8)], :pcap) #   Return ICMP type.
=begin
NOT IMPLEMENTED YET
    PLOT.add_base BaseLine.new("icmp_gwaddr",    [0, 2]) #   Return gateway address of ICMP_REDIRECT message as IPAddress.
    PLOT.add_base BaseLine.new("icmp_id",        [0, 2]) #   Return identifier.
    PLOT.add_base BaseLine.new("icmp_ip",        [0, 2]) #   Return original IP Datagram as IPPacket.
    PLOT.add_base BaseLine.new("icmp_lifetime",  [0, 2]) #   Return lifetime of ICMP_ROUTERADVERT message.
    PLOT.add_base BaseLine.new("icmp_nextmtu",   [0, 2]) #   Return Next Hop MTU of ICMP_UNREACH_NEEDFRAG message (See rfc1191).
    PLOT.add_base BaseLine.new("icmp_num_addrs", [0, 2]) #   Return number of addresses of ICMP_ROUTERADVERT message.
    PLOT.add_base BaseLine.new("icmp_otime",     [0, 2])
    PLOT.add_base BaseLine.new("icmp_rtime",     [0, 2])
    PLOT.add_base BaseLine.new("icmp_ttime",     [0, 2]) #   Return timestamp of ICMP_TSTAMP/ICMP_TSTAMPREPLY message as Time.
    PLOT.add_base BaseLine.new("icmp_pptr",      [0, 2]) #   Return error pointer of ICMP_PARAMPROB message.
    PLOT.add_base BaseLine.new("icmp_radv(nth)", [0, 2]) #   Return nth address entry of ICMP_ROUTERADVERT message. Returned value is a two elements array [address, preference].
    PLOT.add_base BaseLine.new("icmp_seq",       [0, 2]) #   Return sequence number.
    PLOT.add_base BaseLine.new("icmp_seqle",     [0, 2]) #   Return sequence number interpreted as little endian. No small portion of ping command implementations write sequence number in host byte order. Thus the sequence number of ICMP messages transmitted from little endian host may be in little endian.
    PLOT.add_base BaseLine.new("icmp_typestr",   [0, 2]) #   Return string describing ICMP type (e.g. "echo reply").
    PLOT.add_base BaseLine.new("icmp_wpa",       [0, 2]) #   Return word per address entry of ICMP_ROUTERADVERT message.
=end

# UDP AND TCP PORT BASE
PLOT.add_base BaseLine.new("dport",    [0, 2.power!(16)], :pcap) #       Return destination port number.
PLOT.add_base BaseLine.new("sport",    [0, 2.power!(16)], :pcap) #       Return source port number.


